package com.codinghero.zqlb.spider.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.codinghero.util.DateUtils;
import com.codinghero.zqlb.spider.bo.MatchBo;

public class BackupHistoryMatchServlet extends HttpServlet {

	private static final long serialVersionUID = 4576359298728903735L;
	
	private MatchBo matchBo = new MatchBo();
	
    public void doGet(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
    	int[] affectedNums = matchBo.backHistoryMatches();
    	
    	resp.setCharacterEncoding("UTF-8");
    	PrintWriter out = resp.getWriter();
    	out.println("当前时间：" + DateUtils.getTimeStr(new Date()));
    	out.println("历史表中新增了" + affectedNums[0] + "个过期的比赛");
		out.println("正式表中删除了" + affectedNums[1] + "个过期的比赛");
    }

}
